// ----------------------------------------------------------------------------------
// <copyright file="IoC.cs" company="Christopher Hines">
// Copyright (c) 2012 All Right Reserved
// </copyright>
// <author>Chris Hines</author>
// <date>2012-03-23</date>
// <summary>
//     IoC Setup
// </summary>
// ----------------------------------------------------------------------------------

namespace Copperfield.Demo.Web.DependencyResolution
{
    using StructureMap;

    using Copperfield;
    using Copperfield.Demo.Common;
    using Copperfield.Sdk;

    public static class IoC
    {
        public static IContainer Initialize() 
        {
            ObjectFactory.Initialize(x =>
                        {
                            x.Scan(scan =>
                                    {
                                        scan.TheCallingAssembly();
                                        scan.WithDefaultConventions();
                                    });

                            x.EnableContextBasedResolution();

                            x.For<ContextManagerBase<SignContext>>().Use<WebContextManager<SignContext>>();
                        });
            return ObjectFactory.Container;
        }
    }
}